/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package multiface.valentinorusso.jpa;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Diego64
 */
@Entity
@Table(name = "mimetype")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Mimetype.findAll", query = "SELECT m FROM Mimetype m"),
    @NamedQuery(name = "Mimetype.findByEstensione", query = "SELECT m FROM Mimetype m WHERE m.estensione = :estensione"),
    @NamedQuery(name = "Mimetype.findByTipo", query = "SELECT m FROM Mimetype m WHERE m.tipo = :tipo")})
public class Mimetype implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "estensione")
    private String estensione;
    @Basic(optional = false)
    @Column(name = "tipo")
    private String tipo;

    public Mimetype() {
    }

    public Mimetype(String estensione) {
        this.estensione = estensione;
    }

    public Mimetype(String estensione, String tipo) {
        this.estensione = estensione;
        this.tipo = tipo;
    }

    public String getEstensione() {
        return estensione;
    }

    public void setEstensione(String estensione) {
        this.estensione = estensione;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (estensione != null ? estensione.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Mimetype)) {
            return false;
        }
        Mimetype other = (Mimetype) object;
        if ((this.estensione == null && other.estensione != null) || (this.estensione != null && !this.estensione.equals(other.estensione))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "multiface.valentinorusso.jpa.Mimetype[ estensione=" + estensione + " ]";
    }
    
}
